import Vue from 'vue'
import Vuex from 'vuex'
import login from './modules/login'
import zzjg from './modules/zzjg'
import yhqx from './modules/yhqx'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    // 用户信息
    personInfo: {},
    // 面包屑信息
    breadCrumb: [],
    breadCrumbInfo: [],
  },
  mutations: {
    SET_PERSONINFO(state, data) {
      state.personInfo = data
    },
    SET_BREADCRUMB(state, data) {
      state.breadCrumb = data
    },

    SET_BREADCRUMBINFO(state, data) {
      state.breadCrumbInfo = data
    }
  },
  actions: {},
  modules: {
    login,
    zzjg,
    yhqx
  },
  plugins: [
    createPersistedState({
      storage: window.sessionStorage
    })
  ]
})
